﻿
using BusinessObjects.BusinessRules;

namespace BusinessObjects.Report
{
    /// <summary>
    /// 
    /// </summary>
    public class ReportList : BusinessObject
    {
        /// <summary>
        /// </summary>
        public ReportList()
        {
            //validateId
            AddRule(new ValidateId("ReportListId"));
            //validateRequired
            AddRule(new ValidateRequired("ReportGroupId"));
            AddRule(new ValidateRequired("Name"));
            AddRule(new ValidateRequired("IsActive"));
            AddRule(new ValidateRequired("IsTypical"));
            //validateLength
            AddRule(new ValidateLength("Name", 0, 255));
            AddRule(new ValidateLength("InputTypeName", 0, 20));
            AddRule(new ValidateLength("TableName", 0, 100));
        }

        /// <summary>
        /// </summary>
        /// <param name="reportListId"></param>
        /// <param name="reportGroupId"></param>
        /// <param name="name"></param>
        /// <param name="file"></param>
        /// <param name="inputTypeName"></param>
        /// <param name="functionReportName"></param>
        /// <param name="procedureReportName"></param>
        /// <param name="tableName"></param>
        /// <param name="grade"></param>
        /// <param name="description"></param>
        /// <param name="sortOrder"></param>
        /// <param name="isTypical"></param>
        /// <param name="isActive"></param>
        /// <param name="parentId"> </param>
        public ReportList(long reportListId, long reportGroupId, string name, string file, string inputTypeName,
                          string functionReportName, string procedureReportName,
                          string tableName, int grade, string description, int sortOrder, bool isTypical, bool isActive, int parentId)
            : this()
        {
            ReportListId = reportListId;
            ReportGroupId = reportGroupId;
            Name = name;
            File = file;
            InputTypeName = inputTypeName;
            FunctionReportName = functionReportName;
            ProcedureReportName = procedureReportName;
            TableName = tableName;
            Grade = grade;
            SortOrder = sortOrder;
            IsTypical = isTypical;
            Description = description;
            IsActive = isActive;
            ParentId = parentId;

        }

        /// <summary>
        /// </summary>
        public long ReportListId { get; set; }

        /// <summary>
        /// </summary>
        public long ReportGroupId { get; set; }

        /// <summary>
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// </summary>
        public string File { get; set; }

        /// <summary>
        /// </summary>
        public string InputTypeName { get; set; }

        /// <summary>
        /// </summary>
        public string FunctionReportName { get; set; }

        /// <summary>
        /// </summary>
        public string ProcedureReportName { get; set; }

        /// <summary>
        /// </summary>
        public string TableName { get; set; }

        /// <summary>
        /// </summary>
        public int Grade { get; set; }

        /// <summary>
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// </summary>
        public int SortOrder { get; set; }

        /// <summary>
        /// </summary>
        public bool IsTypical { get; set; }

        /// <summary>
        /// </summary>
        public bool IsActive { get; set; }

        /// <summary>
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// </summary>
        public string ReportController { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public int ParentId { get; set; }
    }
}
